const sm4 = require("sm-crypto").sm4;

const KEY = "3879696f4c6e5659522a3433266f2e33";

function encrypt(pliantext, key) {
  return sm4.encrypt(pliantext, key);
}

function decrypt(ciphertext) {
  return sm4.decrypt(ciphertext, KEY);
}

module.exports = {
  encrypt,
  decrypt,
};
